import http from '../utils/request.js'

// 请求首页数据
export const getData = () => {
    // 返回一个 promise 对象
    return http.get('/home/getData')
}

export const getUser = (params) => {
    // 返回用户列表
    return http.get('/user/getUser', params)
}
export const addUser = (data) => {
    return http.post('/user/add', data)
}
export const editUser = (data) => {
    return http.post('/user/edit', data)
}
export const delUser = (data) => {
    return http.post('/user/del', data)
}
export const getMenu = (data) => {
    return http.post('/permission/getMenu', data)
}
export const getMall = (params) => {
    return http.get('/mall/getMall', params)
}
export const delMall = (data) => {
    return http.post('/mall/del', data)
}
export const delAccount = (data) => {
    return http.post('/account/del', data)
}
export const addAccount = (data) => {
    return http.post('/account/add', data)
}
export const editAccount = (data) => {
    return http.post('/account/edit', data)
}
export const getGoods = (params) => {
    return http.get('/goods/getGoods', params)
}
export const addGoods = (data) => {
    return http.post('/goods/add', data)
}
export const editGoods = (data) => {
    return http.post('/goods/edit', data)
}
export const delGoods = (data) => {
    return http.post('/goods/del', data)
}
export const addShop = (data) => {
    return http.post('/shop/add', data)
}
export const editShop = (data) => {
    return http.post('/shop/edit', data)
}
export const delShop = (data) => {
    return http.post('/shop/del', data)
}
export const shopDelGoods = (data) => {
    return http.post('/goods/del', data)
}
export const shopEditGoods = (data) => {
    return http.post('/goods/edit', data)
}